export const ACTIONTABSTATE = {
  "toggle-grid": true,
  "toggle-shown-layout-grids": true,
  "toggle-show-masks": true,
  "toggle-show-artboard-outlines": true,
  "toggle-rulers": true,
  "toggle-sidebar": true,
  "toggle-ui": true,
  "toggle-outlines": true,
  "toggle-layers": true,
  "toggle-publish": true,
  "toggle-library": true,
  "toggle-pixel-preview": true,
  "toggle-checkerboard": true,
  "zoom-in": true,
  "zoom-out": true,
  "zoom-reset": true,
  "zoom-to-fit": true,
  "zoom-to-selection": true,
  "next-artboard": true,
  "previous-artboard": true,
};

export const ACTIONFILEBROWSERSTATE = {
  "toggle-grid": false,
  "toggle-shown-layout-grids": false,
  "toggle-show-masks": false,
  "toggle-show-artboard-outlines": false,
  "toggle-rulers": false,
  "toggle-sidebar": false,
  "toggle-ui": false,
  "toggle-outlines": false,
  "toggle-layers": false,
  "toggle-publish": false,
  "toggle-library": false,
  "toggle-pixel-preview": false,
  "toggle-checkerboard": false,
  "zoom-in": false,
  "zoom-out": false,
  "zoom-reset": false,
  "zoom-to-fit": false,
  "zoom-to-selection": false,
  "next-artboard": false,
  "previous-artboard": false,
};

export const INITACTIONINITSTATE = {
  newFile: true,
  openFileBrowser: true,
  reopenClosedTab: true,
  closeTab: true,
  "save-as": false,
  "export-selected-exportables": false,
  undo: true,
  redo: true,
  "paste-over-selection": false,
  "toggle-dropper": false,
  "set-default-style": false,
  "copy-properties": false,
  "paste-properties": false,
  selectAll: false,
  "deselect-all": false,
  "select-inverse": false,
  "select-same-style": false,
  "select-same-fill": false,
  "select-same-stroke": false,
  "select-same-effect": false,
  "select-same-text": false,
  "select-same-font": false,
  "select-same-instance": false,
  "toggle-grid": false,
  "toggle-shown-layout-grids": false,
  "toggle-show-masks": false,
  "toggle-show-artboard-outlines": false,
  "toggle-rulers": false,
  "toggle-sidebar": false,
  "toggle-ui": false,
  "toggle-outlines": false,
  "toggle-layers": false,
  "toggle-publish": false,
  "toggle-library": false,
  "toggle-pixel-preview": false,
  "toggle-checkerboard": false,
  "zoom-in": false,
  "zoom-out": false,
  "zoom-reset": false,
  "zoom-to-fit": false,
  "zoom-to-selection": false,
  "scale-normal": false,
  "scale-inc0.1": false,
  "scale-dic0.1": false,
  "scale-inc0.05": false,
  "scale-dic0.05": false,
  "next-artboard": false,
  "previous-artboard": false,
  "group-selection": false,
  "ungroup-selection": false,
  "frame-selection": false,
  "mask-selection": false,
  "create-symbol": false,
  "find-symbol": false,
  "reset-symbol": false,
  "detach-instance": false,
  "resize-to-fit": false,
  "toggle-frame-clipping": false,
  "bring-to-front": false,
  "bring-forward": false,
  "send-backward": false,
  "send-to-back": false,
  "flip-horizontal": false,
  "flip-vertical": false,
  "rotate-180": false,
  "rotate-90-counterclockwise": false,
  "rotate-90-clockwise": false,
  "flatten-selection": false,
  "outline-stroke": false,
  "live-boolean-union": false,
  "live-boolean-subtract": false,
  "live-boolean-intersect": false,
  "live-boolean-xor": false,
  "duplicate-in-place": false,
  "delete-selection": false,
  "convert-to-raster": false,
  "toggle-shown-for-selected-nodes": false,
  "toggle-locked-for-selected-nodes": false,
  "hide-sibling-layers": false,
  "collapse-layers": false,
  "remove-fill": false,
  "remove-stroke": false,
  "swap-fill-and-stroke": false,
  "join-selection": false,
  "smooth-join-selection": false,
  "delete-and-heal-selection": false,
  "text-toggle-bold": false,
  "text-toggle-italic": false,
  "text-toggle-underline": false,
  "text-toggle-strikethrough": false,
  "text-original-case": false,
  "text-upper-case": false,
  "text-lower-case": false,
  "round-to-pixels": false,
  "align-left": false,
  "align-horizontal-center": false,
  "align-right": false,
  "align-top": false,
  "align-vertical-center": false,
  "align-bottom": false,
  "pack-horizontal": false,
  "pack-vertical": false,
  "distribute-horizontal-spacing": false,
  "distribute-vertical-spacing": false,
  "distribute-left": false,
  "distribute-horizontal-center": false,
  "distribute-right": false,
  "distribute-top": false,
  "distribute-vertical-center": false,
  "distribute-bottom": false,
};

export const PROPS_WITH_COLOR = [
  "color",
  "backgroundColor",
  "fill",
  "stroke",
  "borderBottomColor",
  "borderRightColor",
  "borderLeftColor",
  "borderTopColor",
  "boxShadow",
];

export const AVAILABLE_THEME_COLOR_VALUE = /^#[a-fA-F0-9]{6,6}$/;
export const AVAILABLE_THEME_FIELDS_COUNT = 43;
export const AVAILABLE_THEME_FIELDS = [
  "text",
  "textActive",
  "textDisabled",
  "borders",
  "bgPanel",
  "bgPanelHover",
  "bgToolbar",
  "bgToolbarHover",
  "bgToolbarActive",
  "fgToolbar",
  "fgToolbarHover",
  "fgToolbarActive",
  "fgToolbarDisabled",
  "fgToolbarFilename",
  "fgToolbarFoldername",
  "fgToolbarChevron",
  "fgToolbarUnsavedicon",
  "fgToolbarLoginButton",
  "fgToolbarLoginButtonBorder",
  "fgToolbarLoginButtonActive",
  "bgOverlay",
  "fgOverlay",
  "bgOverlayOutline",
  "bgOverlayInnerOutline",
  "bgTab",
  "bgTabHover",
  "bgTabActive",
  "fgTab",
  "fgTabHover",
  "fgTabActive",
  "bgHeader",
  "fgHeader",
  "bgHeaderControl",
  "bgHeaderControlHover",
  "bgHeaderControlActive",
  "fgHeaderControl",
  "fgHeaderControlHover",
  "fgHeaderControlActive",
  "fgComponent",
  "fgComponentDisabled",
  "fgComponentDisabledRowActive",
  "bgWindowClose",
  "bgBetaLabel",
];

export const DEFAULT_PALETTE: Themes.Palette = {
  text: "#333333",
  "text-active": "#050505",
  "text-disabled": "#b3b3b3",
  borders: "#e2e2e2",
  "bg-panel": "#ffffff",
  "bg-panel-hover": "#daebf7",
  "bg-toolbar": "#2c2c2c",
  "bg-toolbar-hover": "#000000",
  "bg-toolbar-active": "#18a0fb",
  "fg-toolbar": "#ffffff",
  "fg-toolbar-hover": "#ffffff",
  "fg-toolbar-active": "#ffffff",
  "fg-toolbar-disabled": "#b3b3b3",
  "fg-toolbar-filename": "#ffffff",
  "fg-toolbar-foldername": "#aaaaaa",
  "fg-toolbar-chevron": "#ffffff",
  "fg-toolbar-unsavedicon": "#a1a1a1",
  "fg-toolbar-login-button": "#ffffff",
  "fg-toolbar-login-button-border": "#d3d3d3",
  "fg-toolbar-login-button-active": "#808080",
  "bg-overlay": "#222222",
  "fg-overlay": "#ffffff",
  "bg-overlay-outline": "#292828",
  "bg-overlay-inner-outline": "#000000",
  "bg-tab": "#222222",
  "bg-tab-hover": "#2c2c2c",
  "bg-tab-active": "#2c2c2c",
  "fg-tab": "#ffffff",
  "fg-tab-hover": "#ffffff",
  "fg-tab-active": "#ffffff",
  "bg-header": "#222222",
  "fg-header": "#ffffff",
  "bg-header-control": "#222222",
  "bg-header-control-hover": "#2c2c2c",
  "bg-header-control-active": "#2c2c2c",
  "fg-header-control": "#ffffff",
  "fg-header-control-hover": "#ffffff",
  "fg-header-control-active": "#ffffff",
  "fg-component": "#7b61ff",
  "fg-component-disabled": "#4e428a",
  "fg-component-disabled-row-active": "#bfbafc",
  "bg-window-close": "#e81123",
  "bg-beta-label": "#1bc47d",
};

export const PALETTE_TEXT: Types.Dic<string> = {
  text: "Text",
  "text-active": "Active text",
  "text-disabled": "Disabled text",
  borders: "Borders and divider lines",
  "bg-panel": "Panels bg color",
  "bg-panel-hover": "Panel selected item bg color",
  "bg-toolbar": "Toolbar bg color",
  "bg-toolbar-hover": "Toolbar item hover bg color",
  "bg-toolbar-active": "Toolbar active item bg color",
  "fg-toolbar": "Toolbar icons color",
  "fg-toolbar-hover": "Toolbar hover icons color",
  "fg-toolbar-active": "Toolbar active icon color",
  "fg-toolbar-disabled": "Toolbar disabled icons color",
  "fg-toolbar-filename": "Toolbar file name color",
  "fg-toolbar-foldername": "Toolbar dir name color",
  "fg-toolbar-chevron": "Toolbar chevron color",
  "fg-toolbar-unsavedicon": "Toolbar unsaved icon color",
  "fg-toolbar-login-button": "Toolbar login button color",
  "fg-toolbar-login-button-border": "Toolbar login button border color",
  "fg-toolbar-login-button-active": "Toolbar active login button color",
  "bg-overlay": "Dropdown menu bg color",
  "fg-overlay": "Dropdown menu text color",
  "bg-overlay-outline": "Dropdown menu outline color",
  "bg-overlay-inner-outline": "Dropdown menu inner outline color",
  "bg-tab": "Tab bg color",
  "bg-tab-hover": "Tab hover bg color",
  "bg-tab-active": "Tab active bg color",
  "fg-tab": "Tab text color",
  "fg-tab-hover": "Tab hover text color",
  "fg-tab-active": "Tab active text color",
  "bg-header": "Header bg color",
  "fg-header": "Header text color",
  "bg-header-control": "Header control buttons bg color",
  "bg-header-control-hover": "Header hover control buttons bg color",
  "bg-header-control-active": "Header active control buttons bg color",
  "fg-header-control": "Header control buttons text color",
  "fg-header-control-hover": "Header hover control buttons text color",
  "fg-header-control-active": "Header active control buttons text color",
  "fg-component": "Component color",
  "fg-component-disabled": "Component disabled color",
  "fg-component-disabled-row-active": "Component disabled row active color",
  "bg-window-close": "Window close bg color",
  "bg-beta-label": "Beta button bg color",
};

export const DEFAULT_THEME = {
  name: "Default Theme",
  author: "Figma",
  id: "0",
  palette: DEFAULT_PALETTE,
};

export const SELECTORS_TO_IGNORE = [
  ".action--unfaded",
  ".action--enabled",
  ".action_option",
  ".avatar--root--2kH_E",
  ".basic_form--greenBtn",
  ".dropdown--dropdown",
  ".dropdown_menu",
  ".draggable_modal--backgroundOverlay--CPf6e",
  ".emoji-mart-anchor-selected",
  ".flyout_view--flyout",
  ".folder_view--folderTeamName",
  ".folder_view--pathSeparator",
  ".filename_view--title",
  ".filename_view--pathSeparator",
  ".filename_view--dropdownOption",
  ".fullscreen_menu--searchInput",
  ".header_modal--modalBackground",
  ".header--header--",
  ".header--settings",
  ".header--dropdownCaret",
  ".prototype--background",
  ".multilevel_dropdown--",
  ".library_item_tile--descriptionPopout",
  ".pointing_dropdown",
  ".scaling_menu--",
  ".transition_preview_pane--",
  ".top_bar--",
  ".tooltip--",
  ".toolbar_styles--activeButton",
  ".toolbar_styles--enabledButton",
  ".user_view--name",
  ".text--_whiteText",
  ".team_link--icon",
  ".zoom_menu--zoomMenu",
  ".help_widget--helpWidget",
  ".help_widget--tooltip",
  ".raw_components--iconButtonSelected",
  ".visual_bell",
  ".zoom_menu",
];
